package com.appspot.zarm.game;

public class Player  {

	private String id;
	private PlayerType type;
	private boolean isRobot;

	public Player(String id) {
		setId(id);
	}

	public Player(String id, PlayerType type) {
		setId(id);
		setType(type);
	}
	
	public Player(String id, PlayerType type, boolean isRobot) {
		this(id, type);
		setRobot(isRobot);
	}

	public int hashCode() {
		return getId().hashCode();
	}

	@Override
	public boolean equals(Object obj) {
		if (obj == null) return false;
		Player otherPlayer = (Player) obj;
		if (otherPlayer.getId().equals(getId()) && otherPlayer.getType().equals(getType())) {
			return true;
		}
		return false;
	}

	public PlayerType getType() {
		return type;
	}

	public void setType(PlayerType type) {
		this.type = type;
	}

	public boolean isRobot() {
		return isRobot;
	}

	public void setRobot(boolean isRobot) {
		this.isRobot = isRobot;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}
	
}
